/*
 * @Author: DT1604\ZPL zhoupeili@dpc.com.cn
 * @Date: 2022-05-24 17:17:24
 * @LastEditors: DT1604\ZPL zhoupeili@dpc.com.cn
 * @LastEditTime: 2022-05-28 11:27:24
 * @FilePath: \energy-om-platform\src\store\modules\user.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
    loglevel
  } from '@/api/cabint';
    
  const mutations = {
    SET_LOGLEVEL: (state, loglevel) => {
      state.loglevel = loglevel
    },
  }
  
  const actions = {
    loglevel({
      commit
    }) {
      return new Promise((resolve, reject) => {
        loglevel().then((response) => {
          const {
            data
          } = response;
          commit('SET_LOGLEVEL', data);
          resolve()
        }).catch(error => {
          reject(error)
        })
      })
    },
  }
  
  export default {
    namespaced: true,
    mutations,
    actions
  }
  